<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/pageUtils/template.xhtml">

	<ui:define name="body">
		<h:form>
			<div align="center">
				<p:panel header="Cadastro">
					<h:panelGrid id="Entrada" columns="2">
						<h:outputLabel value="Nome :" />
						<p:inputText id="nome" value="#{eleitorController.eleitor.nome}"
							maxlength="60" />

						<h:outputLabel value="Rua :" />
						<p:inputText id="rua" value="#{eleitorController.eleitor.rua}"
							maxlength="30" />

						<h:outputLabel value="Numero :" />
						<p:inputText id="numero"
							value="#{eleitorController.eleitor.numero}" maxlength="6" />

						<h:outputLabel value="Cep :" />
						<p:inputText id="cep" value="#{eleitorController.eleitor.cep}"
							maxlength="8" />

						<h:outputLabel value="Complemento :" />
						<p:inputText id="complemento"
							value="#{eleitorController.eleitor.complemento}" maxlength="30" />
							
						<h:outputLabel value="Bairro :" />
						<p:inputText id="bairro"
							value="#{eleitorController.eleitor.bairro}" maxlength="30" />
							
						<h:outputLabel value="Celular :" />
						<p:inputText id="celular"
							value="#{eleitorController.eleitor.celular}" maxlength="12" />
							
						<h:outputLabel value="Residencial :" />
						<p:inputText id="residencial"
							value="#{eleitorController.eleitor.residencial}" maxlength="12" />
						
						<h:outputLabel value="Comercial :" />
						<p:inputText id="comercial"
							value="#{eleitorController.eleitor.comercial}" maxlength="12" />
						

						<p:commandButton value="Salvar"
							action="#{eleitorController.salvar}"
							update="Saida Entrada Mensagem" />

					</h:panelGrid>
				</p:panel>
				
				<h:panelGrid id="Saida" columns="1">
				<p:dataTable var="listEleitores" value="#{eleitorController.eleitores}" paginator="true" rows="5" style="width:800px;">  
					   <p:column>  
					      <f:facet name="header"> <h:outputText value="Nome" /> </f:facet>  
					      <h:outputText value="#{listEleitores.nome}" />  
					   </p:column> 
					    
		               <p:column>  
		                  <f:facet name="header"><h:outputText value="Rua" /></f:facet>  
					      <h:outputText value="#{listEleitores.rua}" />
					   </p:column>  
					   
		               <p:column>  
		                  <f:facet name="header"><h:outputText value="Celular" /></f:facet>  
		                  <h:outputText value="#{listEleitores.celular}" />
		               </p:column> 
		                
		               <p:column>  
		                  <p:commandButton title="Editar" update="Entrada" action="#{eleitorController.editar}" image="ui-icon ui-icon-wrench">
		                     <f:setPropertyActionListener target="#{eleitorController.selected}" value="#{listEleitores}" />
		                  </p:commandButton>
		               </p:column>
		               
		               <p:column>  
		                  <p:commandButton title="Deletar" update="Saida Entrada" action="#{eleitorController.deletar}" image="ui-icon ui-icon-trash">
		                     <f:setPropertyActionListener target="#{eleitorController.selected}" value="#{listEleitores}" />
		                  </p:commandButton>                  
		               </p:column> 
				</p:dataTable>
		    </h:panelGrid>

			</div>
		</h:form>
	</ui:define>
</ui:composition>
